﻿using AppSocketModel;
using BCGPSCommon;
using System;
using System.Collections.Generic;

namespace AppSocketService.Vehicle
{
    /// <summary>
    /// 车辆信息接口
    /// </summary>
    public interface IVehicleService
    {
        /// <summary>
        /// 初始化REDIS 获取全部车辆列表
        /// </summary>
        /// <returns></returns>
        List<VehicleDto> InitRedisGetListAll();
         
        /// <summary>
        /// 通过IMEI获取车辆
        /// </summary>
        /// <param name="imei"></param>
        /// <returns></returns>
        VehicleDto GetVehicleByImei(string imei);

        /// <summary>
        /// 添加新车辆
        /// </summary>
        /// <param name="vehicleDto"></param>
        /// <returns></returns>
        VehicleDto AddNew(VehicleRequestDto vehicleDto);

        /// <summary>
        /// 删除车辆
        /// </summary>
        /// <param name="imei"></param>
        /// <returns></returns>
        int Delete(string imei);

        /// <summary>
        /// 修改车辆信息  根据 vehicleNo 
        /// </summary>
        /// <param name="vehicleDto"></param>
        /// <returns></returns>
        VehicleDto Update(VehicleDto vehicleDto);

        /// <summary>
        /// 获取指定账户下全部车辆 不包含子账户
        /// </summary>
        /// <param name="accountId"></param>
        /// <returns></returns>
        List<VehicleDto> GetVehicleList(string accountId);

        /// <summary>
        /// 获取指定账户下车辆列表 不包含子账户  -- 分页
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        PageableList<VehicleDto> GetVehicleList(string accountId, int index, int size);

        /// <summary>
        /// 获取指定账户包括子账户下全部车辆
        /// </summary>
        /// <param name="accountId"></param>
        /// <returns></returns>
        List<VehicleDto> GetVehicleListAll(string accountId);

        /// <summary>
        /// 获取指定车辆信息和定位信息
        /// </summary>
        /// <param name="imei"></param>
        /// <param name="gpsMapType"></param>
        /// <returns></returns>
        VehicleLocationDto GetVehicleLocation(string imei, GpsMapType gpsMapType);


        /// <summary>
        /// 获取指定账户下全部车辆和定位信息 不包含子账户
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="gpsMapType"></param>
        /// <returns></returns>
        List<VehicleLocationDto> GetVehicleLocationList(string accountId, GpsMapType gpsMapType);

        /// <summary>
        /// 获取指定账户包括子账户下全部车辆信息和定位信息
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="gpsMapType"></param>
        /// <returns></returns>
        List<VehicleLocationDto> GetVehicleLocationListAll(string accountId, GpsMapType gpsMapType);

        /// <summary>
        ///  获取指定账户下车辆的设备信息(不包括子账户) -- 分页
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="desc"></param>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        PageableList<DeviceDto> GetDeviceList(string accountId, bool desc, int index, int size);

        /// <summary>
        /// 设置车辆归属账户
        /// </summary>
        /// <param name="imei"></param>
        /// <param name="accountId"></param>
        /// <returns></returns>
        VehicleDto SetVehicleAccount(string imei, string accountId);
    }
}